package com.supplychainapi.dao.prod;

import com.supplychainapi.domain.Treebuild;
import com.supplychainapi.model.ScmTbtreebuild;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;



@Repository
public interface ScmTbtreebuildMapper   extends Mapper<ScmTbtreebuild>{

	List<ScmTbtreebuild> getScmTbtreebuildInfos(String fsShopGUID);

	List<ScmTbtreebuild> getScmTbtreebuildAllInfo(@Param("fsShopGUID")String fsShopGUID,@Param("fsTreeTypeId")String fsTreeTypeId);


	List<ScmTbtreebuild> getScmTbtreebuildAllInfos(@Param("fsShopGUID")String fsShopGUID,@Param("fsTreeTypeId")String fsTreeTypeId,@Param("fdParentNodeCode") String fdParentNodeCode);

    String getCode(@Param("fsShopGUID") String fsShopGUID, @Param("fsTreeTypeId") String fsTreeTypeId);


	int updateByPrimaryKeySelective(ScmTbtreebuild model);


	Integer nameIsExit(@Param("name") String name,@Param("shopGuid") String shopGuid,@Param("fsTreeTypeId") String fsTreeTypeId);


	List<ScmTbtreebuild> getScmTbtreebuildOneLevelInfos(@Param("fsShopGUID")String fsShopGUID,@Param("page")Integer page,@Param("pageSize")Integer pageSize, @Param("fsTreeTypeId")String fsTreeTypeId);


	List<ScmTbtreebuild> selectOneLevel(@Param("type") String type,@Param("shopGuid") String shopGuid);

	List<ScmTbtreebuild> selectChild(@Param("noCode") String noCode,@Param("shopGuid") String shopGuid);


    List<ScmTbtreebuild> getScmTbtreebuildByFsNodeTextAllInfo(@Param("fsShopGUID")String fsShopGUID,@Param("fsTreeTypeId")String fsTreeTypeId, @Param("fsNodeText")String fsNodeText);

	int getQuotesByTreeBuild(@Param("fsTreeTypeId") String fsTreeTypeId,@Param("fsShopGUID") String fsShopGUID,@Param("fsNodeCode") String fsNodeCode);

	int getChildByTreeBuild(@Param("fsShopGUID") String fsShopGUID,@Param("fdParentNodeCode") String fdParentNodeCode,@Param("fsTreeTypeId") String fsTreeTypeId);

	List<ScmTbtreebuild> findChildren(@Param("fsShopGUID") String fsShopGUID,@Param("fdParentNodeCode") String fdParentNodeCode,@Param("fsTreeTypeId") String fsTreeTypeId);

	int delete(ScmTbtreebuild model);

	List<ScmTbtreebuild> getClassListInfo(@Param("fsShopGUID")String fsShopGUID, @Param("fsNodeText")String fsNodeText, @Param("fsTreeTypeId")String fsTreeTypeId);

    List<ScmTbtreebuild> getParentNodeCodeAndNodeCodeInfo(@Param("fsShopGUID") String fsShopGUID, @Param("fsTreeTypeId") String fsTreeTypeId, @Param("fsNodeCode") String fsNodeCode);


	int updateFullText(Treebuild treebuild);

	int updateFullTextByType(Treebuild treebuild);
}